<template>
	<view class="conbox">
		<view class="pingjiatopnox">
			<view class="topbox">
				<view class="tips">
					您对跑腿满意吗？
				</view>
				<view class="statustxt">
					已匿名
				</view>
			</view>

			<view class="bombox">
				<image src="/static/updata/jiedanpop.png" style="width: 100rpx;height: 100rpx;border-radius: 50%;"
					mode=""></image>
				<view class="maintxt">
					王小帅
				</view>

				<view class="btn-bb">
					<view class="no-txt">
						不满意
					</view>

					<view class="yes-txt">
						满意
					</view>
				</view>
			</view>


		</view>

		<view class="pingjiabox">
			<view class="topbox">
				<view class="tips">
					您对跑腿满意吗？
				</view>
				<view class="statustxt">
					已匿名
				</view>
			</view>

			<view class="shangjiabox">
				<image src="/static/updata/shangjia.png" style="width: 120rpx;height: 120rpx;border-radius: 50%;"
					mode=""></image>
				<view class="shangjiatxt">
					商家名字
				</view>
			</view>

			<view class="pingjianumbox">
				<view class="itempingjia">
					<text>商家评分：</text>
					<uni-rate v-model="pfvalue" @change="pfChange" :touchable="false" :value="5" :size="18" :margin="7"
						color="#E9E9E9" active-color="#FFD427" />

				</view>
				<view class="itempingjia">
					<text>服务态度：</text>
					<uni-rate v-model="tdvalue" @change="fwChange" :touchable="false" :value="5" :size="18" :margin="7"
						color="#E9E9E9" active-color="#FFD427" />
				
				</view>
				<view class="itempingjia">
					<text>菜品口味：</text>
					<uni-rate v-model="kwvalue" @change="kwChange" :touchable="false" :value="5" :size="18" :margin="7"
						color="#E9E9E9" active-color="#FFD427" />
				
				</view>
			</view>
			
			
			<view class="text-area">
				<textarea name="pjtxt" id="pjtxt" cols="30" rows="10" placeholder="说点什么..."></textarea>
			</view>
			
			<view class="ikz-updata-box">
				<image v-if="positiveImage && !files[0]" class="ikz-updata-add1" @click="addPic(2)" mode=""
					:src="positiveImage"></image>
				<image v-else-if="files[0]" class="ikz-updata-add1" @click="addPic(2)" mode="" :src="files[0]">
				</image>
				<image v-else class="ikz-updata-add" @click="addPic(2)" mode=""
					src="/static/forum/uploads1.png">
				</image>
			</view>
		</view>
		
		<view class="btn-tijiao">
			<view class="tijoatxt">
				提交
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data( ) {
			return {
				pfvalue: 3,
				tdvalue: 2,
				kwvalue: 1,
				files:[]
			};
		},
		methods: {
			pfChange( e ) {
				console.log( e, '商家评分' );
			},
			fwChange( e ) {
				console.log( e, '服务态度' );
			},
			kwChange( e ) {
				console.log( e, '菜品口味' );
			},
			//选择图片
			addPic( status ) {
			
				var that = this;
				wx.chooseImage( {
					count: 1,
					sizeType: [ 'original', 'compressed' ],
					sourceType: [ 'album', 'camera' ],
					success( res ) {
						// tempFilePath可以作为img标签的src属性显示图片
						if ( status == 2 ) {
							that.files[ 0 ] = res.tempFilePaths[ 0 ];
						} else if ( status == 3 ) {
							that.files[ 1 ] = res.tempFilePaths[ 0 ];
						} else {
							that.files[ 2 ] = res.tempFilePaths[ 0 ];
						}
						that.$forceUpdate( );
						// that.$emit( 'returnFiles', that.files )
					}
				} )
			},
		},
	}
</script>

<style lang="scss" scoped>
	.conbox {
		background-color: #F5F5F5;
		height: 100vh;
		padding: 22rpx 30rpx;
		box-sizing: border-box;
	}

	.pingjiatopnox {
		width: 690rpx;
		height: 234rpx;
		background: #FFFFFF;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
		padding: 0 16rpx;
		box-sizing: border-box;

		.topbox {
			width: 100%;
			height: 76rpx;
			display: flex;
			align-items: center;
			justify-content: space-between;
			border-bottom: 1rpx solid #B8D5FF;

			.tips {
				width: 50%;
				height: 44rpx;
				font-weight: 500;
				font-size: 30rpx;
				color: #247EFF;
				text-align: left;
			}

			.statustxt {
				width: 50%;
				height: 36rpx;
				font-weight: 400;
				font-size: 24rpx;
				color: #AFAFAF;
				text-align: right;
			}
		}

		.bombox {
			width: 100%;
			height: 156rpx;
			display: flex;
			align-items: center;

			.maintxt {
				width: 310rpx;
				height: 100rpx;
				display: flex;
				align-items: center;
				font-weight: 400;
				font-size: 28rpx;
				color: #000000;
				text-align: left;
				padding-left: 16rpx;
				box-sizing: border-box;
			}

			.btn-bb {
				width: 248rpx;
				height: 100rpx;
				display: flex;
				align-items: center;
				justify-content: space-between;

				.no-txt {
					width: 112rpx;
					height: 48rpx;
					background: #FFFFFF;
					border-radius: 8rpx 8rpx 8rpx 8rpx;
					border: 2rpx solid #FF4F21;
					font-weight: 400;
					font-size: 24rpx;
					color: #FF4F21;
					text-align: center;
					line-height: 48rpx;
				}

				.yes-txt {
					width: 112rpx;
					height: 48rpx;
					background: #FF4F21;
					border-radius: 8rpx 8rpx 8rpx 8rpx;
					font-weight: 400;
					font-size: 24rpx;
					color: #FFFFFF;
					text-align: center;
					line-height: 48rpx;
				}
			}
		}
	}

	.pingjiabox {
		width: 690rpx;
		height: 932rpx;
		background: #FFFFFF;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
		padding: 0 16rpx;
		box-sizing: border-box;
		margin-top: 24rpx;


		.topbox {
			width: 100%;
			height: 76rpx;
			display: flex;
			align-items: center;
			justify-content: space-between;
			border-bottom: 1rpx solid #B8D5FF;

			.tips {
				width: 50%;
				height: 44rpx;
				font-weight: 500;
				font-size: 30rpx;
				color: #247EFF;
				text-align: left;
			}

			.statustxt {
				width: 50%;
				height: 36rpx;
				font-weight: 400;
				font-size: 24rpx;
				color: #AFAFAF;
				text-align: right;
			}
		}

		.shangjiabox {
			width: 100%;
			height: 120rpx;
			margin-top: 16rpx;
			margin-bottom: 40rpx;
			display: flex;
			align-items: center;

			.shangjiatxt {
				width: 538;
				height: 120rpx;
				font-weight: 400;
				font-size: 28rpx;
				color: #000000;
				text-align: left;
				padding-left: 16rpx;
				box-sizing: border-box;
				line-height: 120rpx;
			}
		}
		
		.pingjianumbox{
			width: 100%;
			height: 168rpx;
			display: flex;
			flex-direction: column;
			align-items: center;
			justify-content: space-between;
			
			.itempingjia{
				width: 100%;
				height: 38rpx;
				display: flex;
			}
		}
		
		.text-area{
			width: 658rpx;
			height: 210rpx;
			background: #F5F7FB;
			border-radius: 20rpx 20rpx 20rpx 20rpx;
			padding: 20rpx;
			box-sizing: border-box;
			margin-top: 40rpx;
			
			#pjtxt{
				width: 100%;
				height: 100%;
			}
		}
		
		.ikz-updata-box {
			width: 100%;
			min-height: 166rpx;
			display: flex;
			// align-items: center;
			flex-direction: column;
			justify-content: space-around;
			margin-top: 24rpx;
			
			.ikz-updata-add1 {
				width: 166rpx;
				height: 166rpx;
			}
			
			.ikz-updata-add {
				width: 166rpx;
				height: 166rpx;
			}
		}
	}

	.btn-tijiao{
		width: 750rpx;
		height: 176rpx;
		background: #FFFFFF;
		border-radius: 24rpx 24rpx 0rpx 0rpx;
		position: fixed;
		bottom: 0;
		left: 0;
		
		.tijoatxt{
			width: 690rpx;
			height: 88rpx;
			background: #247EFF;
			border-radius: 44rpx 44rpx 44rpx 44rpx;
			margin: 14rpx auto;
			font-weight: 400;
			font-size: 30rpx;
			color: #FFFFFF;
			text-align: center;
			line-height: 88rpx;
		}
	}
</style>